import request from '../utils/request'

// 获取用户地址列表
export const getAddressList = (userId) => {
  return request({
    url: '/api/address/getAddress',
    method: 'get',
    params: { userId }
  })
}

// 获取所有地址
export const getAllAddress = () => {
  return request({
    url: '/api/address/getAllAddress',
    method: 'get'
  })
}

// 添加新地址
export const addAddress = (data) => {
  return request({
    url: '/api/address/addAddress',
    method: 'post',
    data
  })
}



// 更新地址信息
export const updateAddress = (data) => {
  return request({
    url: '/api/address/updateAddress',
    method: 'post',
    data
  })
}

// 删除地址
export const deleteAddress = (id) => {
  return request({
    url: '/api/address/delAddress',
    method: 'post',
    data: { id }
  })
}